package com.wxh.bomb.httpserver.servlet;


import com.wxh.bomb.httpserver.server.Request;
import com.wxh.bomb.httpserver.server.Response;
import com.wxh.bomb.httpserver.server.Servlet;

public class LoginServlet extends Servlet {

	@Override
	public void doGet(Request req, Response rep) throws Exception {
		String name = req.getParameter("name");
		String pwd = req.getParameter("pwd");
		if(login(name,pwd)){
			rep.println("登陆成功");
		}else{
			rep.println("登陆失败");
		}
	}
	
	public boolean login(String name,String pwd){
		if(null == name || null == pwd){
			return false;
		}
		return name.equals("wxh") && pwd.equals("12346");
	}
	
	
	@Override
	public void doPost(Request req,Response rep) throws Exception {
		
	}

}
